<%@page import="org.cx.oa.entity.TotalUpload"%>
<%@page import="org.cx.oa.entity.Employee"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'totakUpload.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script src="css/SpryTabbedPanels.js" type="text/javascript"></script>
    <link href="css/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
  </head>
  
  <body>
  <div id="TabbedPanels1" class="TabbedPanels">
  <ul class="TabbedPanelsTabGroup">
    <li class="TabbedPanelsTab" >下载</li>
    <li class="TabbedPanelsTab" >上传</li>
  </ul>
  <div class="TabbedPanelsContentGroup">
    <div class="TabbedPanelsContent">
    <center>
    <form action="TotakUpload_execute" method="post">
    <select name="select" id="select">
    <s:if test="select==null || select==''">
    	<option value="" >全部</option>
    	<option value="用户名">用户名</option>
  		<option value="文件名">文件名</option>
    </s:if>
    <s:elseif test="select=='用户名'">
    	<option value="" >全部</option>
    	<option value="用户名" selected="selected">用户名</option>
  		<option value="文件名">文件名</option>
    </s:elseif>
  	<s:elseif test="select =='文件名'">
  	<option value="" >全部</option>
    	<option value="用户名" >用户名</option>
  		<option value="文件名" selected="selected">文件名</option>
  	</s:elseif>
	</select>
		<input name="condition" type="text" size="20" value="${condition}" />
		<input type="submit"  value="提交" />
		</form>
		</center>
       <table width="100%" border="1">
         <tr>
           <th scope="col">用户名</th>
           <th scope="col">文件名</th>
           <th scope="col">上传时间</th>
           <th scope="col">下载次数</th>
           <th scope="col">文件大小</th>
           <th scope="col">操作</th>
         </tr>
          <s:iterator value="totalUploads" id="totalUpload">
         <tr>
           <td><s:property value="#totalUpload.employee.usertrueName"/></td>
           <td><s:property value="#totalUpload.totalName"/></td>
           <td> <s:date name="#totalUpload.totalDate" format="yyyy-MM-dd hh:mm:ss" var="d"/>
          <s:property value="#d"/></td>
           <td><s:property value="#totalUpload.totalNode"/></td>
           <td><s:property value="#totalUpload.totaSize"/>M</td>
           <td>
           <table>
           <tr>
           <td>
           <form action="TotakUpload_download" method="post">
           	 <input type="hidden" name="filename" value="${totalUpload.totalName}">
           	 <input type="hidden" name="totalUploadId" value="${totalUpload.id}">
           <input type="submit" value="下载" />
           </form>
           </td>
           <td>
           <s:if test="#totalUpload.employee.id==user.id">
           <form action="TotakUpload_delete" method="post">
           	<input type="hidden" name="filename" value="${totalUpload.totalName}">
            <input type="hidden" name="totalUploadId" value="${totalUpload.id}">
           <input type="submit"  value="删除" />
           </form>
           </s:if>
           </td>
           </tr>
           </table>
           </td>
         </tr>
         </s:iterator>
         <tr>
          <td colspan="7" align="center">
          <form action="TotakUpload_fenye" method="post">
          <s:if test="page!=1">
          	<a href="TotakUpload_fenye?page=1">首页</a>
          	 <a href="TotakUpload_fenye?page=${page-1}">上页 </a>
          </s:if>
          <s:if test="page!=sumPage">
          	 <a href="TotakUpload_fenye?page=${page+1}">下页</a> 
          	<a href="TotakUpload_fenye?page=${sumPage}">尾页</a>
          </s:if>
          	  页次${page}/${sumPage}   共有 ${sum}条数据     跳到
            <select name="page" >
            <s:iterator begin="1" end="sumPage">
              <option value="<s:property/>"><s:property/></option>
              </s:iterator>
            </select>
            <input type="submit" value="跳转">
            </form>
          </td>
        </tr>
       </table>
    </div>
    <div class="TabbedPanelsContent">
    	<s:form enctype="multipart/form-data" action="TotakUpload_upload" method="post">
    <s:file name="uploadFiles"></s:file>
     <s:file name="uploadFiles"></s:file>
     <s:file name="uploadFiles"></s:file>
     <s:file name="uploadFiles"></s:file>
     <s:file name="uploadFiles"></s:file>
    <s:submit value="上传"></s:submit>
    </s:form>
    </div>
  </div>
</div>
<script type="text/javascript">
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
</script>   
  </body>
</html>
